package com.hust.controller;

import com.hust.domain.PageResult;
import com.hust.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.math.BigInteger;
import java.util.Hashtable;
import java.util.List;
import java.util.Vector;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;


@Controller
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    private AdminService adminService;

    @RequestMapping("/user")
    @ResponseBody
    public PageResult adminUser(Integer page, Integer limit){
        PageResult pageResult = adminService.showUser(page, limit);
        return pageResult;
    }

    @RequestMapping("/item")
    @ResponseBody
    public PageResult adminItem(Integer page, Integer limit){
        PageResult pageResult = adminService.showItem(page, limit);
        return pageResult;

    }
    @RequestMapping("/del")
   //@CrossOrigin
 /*   public String delete(@RequestParam("idList") String idList) {
        System.out.println("idList"+idList);
       return "sucess";
    }*/

    public String delete(@RequestBody String idList) {
        System.out.println("idList"+idList);
        return "sucess";
    }

}
